/*
 * Printer class represents a device capable of graphically displaying a character
 * Printer subscribes to the Device interface
 * */

package system.device;

import cpu.components.DeviceUnit;
import cpu.datatypes.*;
import cpu.interfaces.*;

public class Printer implements Device {

	private DeviceUnit controller;
	private ui.Printer printerUI;
	
	public Printer( ui.Printer printerUI ) {
		this.printerUI = printerUI;
	}
	
	public void enroll( int id, cpu.components.DeviceUnit controller ) {
		this.controller = controller;
		controller.enroll( id, this );
	}
	
	public void get( ) {
		// controller.DBR <- Device(controller.DID)
	}
	public void put( ) {
		// Device(controller.DID) <- controller.DBR;
		
		printerUI.print( (char) controller.DBR.toSignedInteger() );
	}
	public void status( ) {
		// controller.DSR <- Device(controller.DID)
		// Note that this is a status query
	}
}